<template>
  <div class="container">
    <div class="content">
      <scroll-view scroll-y="true" style="height:100%">
        <rich-text :nodes="content" v-if="content !=''"></rich-text>
        <!-- 没有找到想要的内容 -->
        <div class="empty" v-else>
          <img src="https://h5.ameimeika.com/mp_images/mp_2.7/empty@2x.png" alt class="nothing">
          <div class="text">没有找到宝宝想看的内容</div>
        </div>
      </scroll-view>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      content: ""
    };
  },
  onLoad(options) {
    Object.assign(this.$data, this.$options.data());
    if (options) {
      wx.setNavigationBarTitle({
        title: options.cate_name
      });
      let content = wx.getStorageSync("content");
      if (content != null) {
        this.content = content;
      } else {
        this.content = "";
      }
    }
  },
  methods: {}
};
</script>

<style lang="less" scoped>
.container {
  width: 100%;
  height: 100%;
  background-color: #f3f4f6;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  .content {
    height: 97%;
    padding: 10px 15px;
    .desc {
      font-size: 14px;
      font-weight: 400;
      color: #666666;
      line-height: 20px;
    }
    // 没有找到想要的内容
    .empty {
      width: 154px;
      margin: 0 auto;
      padding: 40% 0;
      .nothing {
        width: 128px;
        height: 114px;
        margin: 0 auto;
        display: block;
      }
      .text {
        width: 100%;
        font-size: 14px;
        font-weight: 400;
        margin-top: 13px;
        color: rgba(153, 153, 153, 1);
        text-align: center;
      }
    }
  }
}
</style>


